import { defineStore } from "pinia";

/**
 * 修改配置时：
 * 1、需要每次都清理 `window.localStorage` 浏览器永久缓存
 * 2、或者点击布局配置最底部 `一键恢复默认` 按钮即可看到效果
 */
export const useThemeConfig = defineStore("themeConfig", {
  state: (): ThemeConfigState => ({
    themeConfig: {
      isDrawer: false,
      primary: "#4D6BF6",
      isIsDark: false,
      topBar: "linear-gradient( 90deg, #4D6BF6 0%, #4A85F6 58%, #55B8FF 100%)",
      topBarColor: "#ffffff",
      isTopBarColorGradual: false,
      menuBar: "#ffffff",
      menuBarColor: "#000000",
      menuBarActiveColor: "rgba(223, 228, 249, 1)",
      isMenuBarColorGradual: false,
      columnsMenuBar: "#545c64",
      columnsMenuBarColor: "#e6e6e6",
      isColumnsMenuBarColorGradual: false,
      isColumnsMenuHoverPreload: false,
      isCollapse: false,
      isUniqueOpened: true,
      isFixedHeader: true,
      isFixedHeaderChange: false,
      isClassicSplitMenu: true,
      isLockScreen: false,
      lockScreenTime: 30,
      isShowLogo: true,
      isShowLogoChange: false,
      isBreadcrumb: true,
      isTagsview: false,
      isBreadcrumbIcon: false,
      isTagsviewIcon: false,
      isCacheTagsView: true,
      isSortableTagsView: true,
      isShareTagsView: false,
      isFooter: false,
      isGrayscale: false,
      isInvert: false,
      isWartermark: false,
      wartermarkText: "jxtech",
      tagsStyle: "tags-style-five",
      animation: "slide-right",
      columnsAsideStyle: "columns-round",
      columnsAsideLayout: "columns-vertical",
      layout: "defaults",
      isRequestRoutes: true,
      globalTitle: "运企管理服务平台",
      globalViceTitle: "运企管理服务平台",
      globalViceTitleMsg: "运企管理服务平台",
      globalI18n: "zh-cn",
      globalComponentSize: "default",
      footerAuthor: "©2024 jxtech.com",
    },
  }),
  actions: {
    setThemeConfig(data: ThemeConfigState) {
      this.themeConfig = data.themeConfig;
    },
  },
});
